<template>
	<view class="container">
		<fu-navbar title="新增工作项" bgColor="#0f68f0" color="#fff" isBackText></fu-navbar>
		<view class="content">
			<view class="padding-tb-32 border-b-c9 flex align-center justify-between item fs-26">
				<view class="flex-shrink">工作类型</view>
				<input class="ipt" placeholder="请输入" placeholder-class="pla-ipt" />
			</view>
			<view class="padding-tb-32 border-b-c9 flex align-center justify-between item fs-26">
				<view class="flex-shrink">所属设备</view>
				<view class="flex align-center" @click="navTo('/pages/inspection/equipment/index')">
					<view class="color-c" v-if="!emName">选择设备</view>
					<view class="" v-else>{{emName}}</view>
					<image src="../../../static/images/arrow-r.png" class="arrow-r" mode="widthFix"></image>
				</view>
			</view>
			<view class="padding-tb-32 border-b-c9 flex align-center justify-between item fs-26">
				<view class="flex-shrink">工作内容</view>
				<input class="ipt" placeholder="请输入" placeholder-class="pla-ipt" />
			</view>
			<view class="padding-tb-32 flex item fs-26">
				<view class="flex-shrink margin-r-24">工作描述</view>
				<textarea class="tra" placeholder="请输入内容" placeholder-class="pla-ipt" />
			</view>
		</view>
		<view class="btn-wrap">
			<view class="btn" @click="submit">保存</view>
		</view>
	</view>
</template>

<script>
export default {
	data() {
		return {
			emName: ''
		}
	},
	onLoad() {
		
	},
	onShow() {
		uni.$on('getDevice', data => {
			console.log(data)
			this.emName = data.emName
		})
	},
	onUnload() {
		uni.$off('getDevice')
	},
	methods: {
		navTo(path) {
			uni.navigateTo({
				url: path
			})
		}
	}
}
</script>

<style lang="scss" scoped>
.content {
	padding: 24rpx;
	.item {
		.ipt {
			text-align: right;
			font-size: 26rpx;
		}
		.pla-ipt {
			color: #ccc;
		}
		.arrow-r {
			width: 32rpx;
		}
		.tra {
			height: 180rpx;
			font-size: 26rpx;
			border: 1rpx solid #c9c9c9;
			padding: 12rpx;
			border-radius: 10rpx;
		}
	}
}
.btn-wrap {
	height: 138rpx;
	.btn {
		position: fixed;
		bottom: 30rpx;
		width: 70%;
		left: 0;
		right: 0;
		margin: 0 auto;
		height: 98rpx;
		background-color: #007aff;
		text-align: center;
		line-height: 98rpx;
		text-align: center;
		font-size: 36rpx;
		color: #fff;
		border-radius: 12rpx;
		z-index: 9;
	}
}
</style>